package com.ssm.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;
import java.util.Date;
import java.io.Serializable;

/**
 * (SysRole)实体类
 *
 * @author makejava
 * @since 2021-06-02 13:56:07
 */
public class SysRole implements Serializable {
    private static final long serialVersionUID = -33105616665290047L;
    /**
     * 角色id
     */
    private Integer id;


    /**
     * 角色名
     */
    @NotBlank(message = "角色名称不能为空")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5_a-zA-Z0-9]+$")
    @Length(min = 1,max = 20,message = "角色名称需要在1~20个字符以内")
    private String roleName;
    /**
     * 角色创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    /**
     * 角色更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;
    /**
     * 是否删除
     */
    private Integer del;


    public SysRole() {
    }

    public SysRole(String roleName) {
        this.roleName = roleName;
    }

    public SysRole(Integer id, String roleName) {
        this.id = id;
        this.roleName = roleName;
    }

    public SysRole(Integer id, String roleName, Date createTime, Date updateTime) {
        this.id = id;
        this.roleName = roleName;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "SysRole{" +
                "id=" + id +
                ", roleName='" + roleName + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
